<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String picpath = "http://localhost/pictures/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>衣着 List page</title>
    </head>
    <body>
        <h1>衣着 List page</h1>
        <table style="text-align: center;" border="1px" cellpadding="0" cellspacing="0" >
            <thead>
                <tr>
                    <th width="25px">id</th>
                    <th width="150px">标题</th>
                    <th >图片</th>
                    <th width="25px">描述</th>
                    <th width="50px">动作</th>
                </tr>
            </thead>
            <tbody>
                <c:forEach var="dressing" items="${dressings}">
                    <tr>
                        <td>${dressing.id}</td>
                        <td>${dressing.title}</td>
                        <td ><img style="width:100px" src="<%=picpath%>${dressing.id}" /></td>
                        <td>${dressing.caption}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/dressings/${dressing.id}/edit">编辑</a><br/>
                            <a href="${pageContext.request.contextPath}/dressings/${dressing.id}/destroy">删除</a><br/>
                        </td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
        <a href="${pageContext.request.contextPath}/">Home page</a>
        <a href="${pageContext.request.contextPath}/dressings/new">新建</a>
    </body>
</html>